package com.humngyang.com.hmy.study.shuzu;


import java.text.Collator;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class test {


    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.myinsertorder(10);
        myArrayList.myinsertorder(16);
        myArrayList.myinsertorder(15);
        myArrayList.myinsertorder(19);
        myArrayList.myinsertorder(20);
/*


        System.out.println("================");
        System.out.println(myArrayList.mysearchindex(1));
        System.out.println("================");
        System.out.println(myArrayList.mysearchvalue(13));

*/
        /*myArrayList.mydisplay();
        myArrayList.mydeleteindex(1);
        myArrayList.mydisplay();
        System.out.println("================");
        myArrayList.mydeletevalue(10);
        myArrayList.mydisplay();
        System.out.println("================");
        myArrayList.myupdate(1,15);
        myArrayList.mydisplay();*/
/*

        myArrayList.mydisplay();
        int mybinarysearch = myArrayList.mybinarysearch(16);
        System.out.println();
        System.out.println(mybinarysearch);
*/

        System.out.println("-----==========冒泡排序===--------");
        long[] arr = {1, 3, 6, 3, 9, 2};
  /*      long[] bubblesort = Sort.bubblesort(arr);
        System.out.print("[");
        for (long l : bubblesort) {
            System.out.print(l+" ");
        }
        System.out.print("]");
        System.out.println();
*/

/*        System.out.println("-----==========直接排序===--------");
        long[] directselectsort = Sort.directselectsort(arr);
        System.out.print("[");
        for (long l : directselectsort) {
            System.out.print(l+" ");
        }
        System.out.print("]");
        System.out.println();*/

    /*    System.out.println("-----==========直接插入排序===--------");
        long[] directinsertsort = Sort.directinsertsort(arr);
        System.out.print("[");
        for (long l : directinsertsort) {
            System.out.print(l+" ");
        }
        System.out.print("]");*/

/*
        Stack stack = new Stack();
        stack.mypush(1);
        stack.mypush(3);
        stack.mypush(4);
        stack.mypush(2);

        System.out.println(stack.myidEmpty());
        System.out.println(stack.myisfull());



        System.out.println(stack.myidEmpty());
        System.out.println(stack.myisfull());


        System.out.println(stack.mypeek());
        System.out.println(stack.mypeek());

        while (!stack.myidEmpty()){
            System.out.print("===>"+stack.mypop()+" ");
        }*/

        Comparator<Object> com = Collator.getInstance(java.util.Locale.CHINA);
        String[] newArray = {"中山", "汕头", "广州", "安庆", "阳江", "南京", "武汉", "北京", "安阳", "北方"};
        List<String> list = Arrays.asList(newArray);
        Collections.sort(list, com);
        for (String i : list) {
            System.out.print(i + "  ");
        }

    }


}





